package com.mrd.gtimp.business.entity;

import org.hibernate.annotations.GenericGenerator;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;

/**
 * <p>
 * application name: sample
 * <p>
 * copyright: Copyright@2012 明睿达科技有限公司
 */
/**
 * 装货地址信息表
 * @author winaya
 */
@Entity(name = "T_BIZ_GOODSADDRESS")
public class GoodAddress {
	/**
	 * id
	 */
	@Id
	@GeneratedValue(generator = "paymentableGenerator")
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
	@Column(name = "ID")
	private String	        id;
	/**
	 * 货物名称
	 */
	@Column(name = "NAME")
	private String	        name;
	/**
	 * 联系人信息
	 */
	@ManyToOne
	@JoinColumn(name = "CONTACTER_ID")
	private Contacter	    contacter;
	/**
	 * 所需柜型柜量，格式为:柜量1*柜型1/柜量2*柜型2....，在前台进行格式控制
	 */
	@Column(name = "CTNUMTYPE")
	private String	        ctNumType;
	/**
	 * 所需柜型柜量与so，格式为:柜量1*柜型1+so号/柜量2*柜型2....，在前台进行格式控制
	 */
	private String	        ctNumTypeSo;
	/**
	 * 建议装柜时间，精确到时
	 */
	@Column(name = "ZHDATE")
	private Date	        zhDate;
	/**
	 * 备注
	 */
	@Column(name = "REMARK")
	private String	        remark;
	/**
	 * SO号码
	 */
	@Column(name = "SO")
	private String	        so;

	/**
	 * 反馈信息
	 */
	/**
	 * 发车信息和车信息
	 */
	@ManyToMany
	@JoinTable(name = "T_BIZ_GOODSADDRESS_CARMSG", joinColumns = @JoinColumn(name = "ADDR_ID",
	        updatable = false), inverseJoinColumns = @JoinColumn(name = "CAR_ID"))
	private List<CarMsg>	carmsges;

	/**
	 * 业务前置相关货柜信息
	 */
	@ManyToMany
	@JoinTable(name = "T_BIZ_CT_GOODSADDRESS", joinColumns = @JoinColumn(name = "GA_ID",
	        updatable = false), inverseJoinColumns = @JoinColumn(name = "CT_ID"))
	private List<Container>	containers;

	/**
	 * 所属拖车业务信息
	 */
	@ManyToOne
	@JoinColumn(name = "TRAIL_ID")
	private Trail	        trail;

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Contacter getContacter() {
		return contacter;
	}

	public void setContacter(Contacter contacter) {
		this.contacter = contacter;
	}

	public Date getZhDate() {
		return zhDate;
	}

	public void setZhDate(Date zhDate) {
		this.zhDate = zhDate;
	}

	public List<CarMsg> getCarmsges() {
		return carmsges;
	}

	public void setCarmsges(List<CarMsg> carmsges) {
		this.carmsges = carmsges;
	}

	public Trail getTrail() {
		return trail;
	}

	public void setTrail(Trail trail) {
		this.trail = trail;
	}

	public String getCtNumType() {
		return ctNumType;
	}

	public void setCtNumType(String ctNumType) {
		this.ctNumType = ctNumType;
	}

	public List<Container> getContainers() {
		return containers;
	}

	public void setContainers(List<Container> containers) {
		this.containers = containers;
	}

	public String getSo() {
		return so;
	}

	public void setSo(String so) {
		this.so = so;
	}

	public String getCtNumTypeSo() {
		return ctNumTypeSo;
	}

	public void setCtNumTypeSo(String ctNumTypeSo) {
		this.ctNumTypeSo = ctNumTypeSo;
	}

}
